package algotithm.leetcode.bit.test1486;

/**
 * @author 25068
 * @Date 2021/5/7 9:47
 * @Title 1486. 数组异或操作
 */
public class Solution {

    public static void main(String[] args) {
        Solution solution = new Solution();
        int n = 5;
        int start = 0;
        int operation = solution.xorOperation(n, start);
        System.out.println(operation);
    }


    public int xorOperation(int n, int start) {
        int ans = 0;
        for (int i = 0; i < n; i++) {
            ans ^= (start + 2 * i);
        }
        return ans;
    }
}
